Subject: Re: XCEXIT, please explain (was: SAS/C 6.50 bug/feature ?)
From: [email-masked] (Doug Walker)
Date: Mon, 9 May 1994 12:59:49 GMT
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]>, [email-masked] (Ralph Seichter) writes:
|> the  NoStackCheck option. It uses ANSI-C file I/O (fread, fwrite, etc.) and
|> I  guess that at least one of these functions refers to _XCEXIT. As I don't
|> want any startup code, I use my own replacement function:
|> 
|>    VOID __stdargs _XCEXIT (LONG dummy) { return; }
|> 
|> This  is  almost certainly no wise behaviour, but maybe someone can tell me
|> what else to do if I need to use "lib:sc.lib" without "lib:c.o".

ANSI I/O checks for CTRL-C, and the CTRL-C processing code calls
exit(), which calls _XCEXIT() eventually.  You need to disable CTRL-C 
checking if you don't want to have this reference.  Do it by adding
this function to your code somewhere:

   void __regargs __chkabort(void){}

The __regargs is important; what you are doing is replacing the
library version of __chkabort() with your own.  The library code
in the ANSI I/O functions calls the regargs version of __chkabort(),
not the stdargs version, so if you define a stdargs version, it won't
work.

-- 
  *****                    / [email-masked]
 *|_o_o|\\     Doug Walker<  BIX, Portal: djwalker
 *|. o.| ||                \ CompuServe: 71165,2274
  | o  |//     
  ====== 
Any opinions expressed are mine, not those of SAS Institute, Inc.